/// @description Insert description here
// You can write your code in this editor

if(gety){
	with(objPlayer){
		var tem1 = collision_line(x+15+-1*16,y,x+15+-1*16,y+31,objBlockFather,0,0),tem2 = collision_line(x+17+1*16,y,x+17+1*16,y+31,objBlockFather,0,0)
		//var collsion = place_meeting(x+dx*psp,y,objBlockFather) && place_free(x+dx*psp,y) == false;
		//if(collsion == false){
		//	x += dx*psp;
		//}
		if(!tem1 and other.temvar[? "a"]==1){
			x += -3
			//image_index+=0.1;
		}
		if(!tem2 and other.temvar[? "a"]==2){
			x += 3
		}
	}
}
//damage
var tem = instance_place((image_xscale==1) ? x:x+128,y,obj_point)
while(tem){
	hp--;
	with(tem){instance_destroy()}
	tem = instance_place((image_xscale==1) ? x:x+128,y,obj_point);
}

var tem = instance_place((image_xscale==1) ? x:x+128,y,obj_point1)
if(tem){
	hp-=5;
	with(tem){instance_destroy()}
	blood++;
	if(blood>5) blood=5;
	temvar[? "point"]=15;
	alarm[0] = 60;
}

var tem = instance_place((image_xscale==1) ? x:x+128,y,objPlayer)
if(tem){
	with(tem){
		die = 1;
	}
}
//move
if(!place_free(x+hspeed+(image_xscale==1 ? 0:128),y) && !frozen){
	hspeed = -hspeed;
}
//attect
if(ac>0 || ac==-1) exit;
audio_play_sound(sndFire,1,0);
frozen=1;
hspeed=0;
alarm[2]=fps;
ac = fps*4;
/*
var tem = irandom_range(1,1000);
if(tem < 10){
	frozen=1;
	hspeed=0;
	alarm[2]=1;
	ac =60*1;
}
if(tem >= 200 && tem <=210){
	frozen=1;
	state = 2;
	temvar[? "a"] = irandom_range(1,2);
	hspeed=0;
	ac =60*4.5;
	alarm[3]=fps*3;
}
if(tem >= 490 && tem <=500){
	frozen=1;
	state = 2;
	temvar[? "a"] = irandom_range(1,2);
	hspeed=0;
	ac =fps*8;
	alarm[6]=fps*3;
}
if(tem >= 985){
	//frozen=1;
	//state = 2;
	//temvar[? "a"] = irandom_range(1,2);
	hspeed=0;
	//ac =60;
	alarm[9]=1;
	//alarm[2]=fps+fps/10;
	//ac =fps;
}
*/